import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

///author: create by SunJH
///时间: 2021/12/24 0024
///邮箱: 965989158@qq.com
///描述: web_flutter测试页
///

class WebFlutter extends StatelessWidget {
  WebFlutter({Key? key}) : super(key: key);
  WebViewController? _webViewController;

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        if (_webViewController != null &&
            await _webViewController!.canGoBack()) {
          _webViewController?.goBack();
          return false;
        }
        return true;
      },
      child: Scaffold(
        body: WebView(
          initialUrl: 'https://test-c-ks.qimingdaren.com/',
          onWebViewCreated: (controller) {
            _webViewController = controller;
          },
        ),
      ),
    );
  }
}
